package hello.web.filter;

import hello.config.MyConfig;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @description
 * 
 * @author Administrator - JingjingMa
 * @Email <a href="majinding888@163.com">majinding888@163.com</a>
 * @date 2016-12-25 下午2:17:43
 * @version 6.0
 * @DevTool Created By Eclipse 4.3
 * 
 */
@WebListener
public class MyListener implements ServletContextListener {
	private Logger log = LoggerFactory.getLogger(this.getClass());

	@Autowired
	MyConfig config;
	
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		log.info("MyListener.contextDestroyed()...");
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		log.info("MyListener.contextInitialized()...");
		arg0.getServletContext().setAttribute("config", config);
	}

}
